package com.example.xd.phone_album

import android.content.Context
import android.widget.ImageView
import android.widget.TextView
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder

/**
 * @auther XuDan on 2020/9/8.
 */
class VideoAdapter(context: Context, layoutResId: Int, data: MutableList<SingleImageModel>?) :
    BaseQuickAdapter<SingleImageModel, BaseViewHolder>(layoutResId, data) {
    var context: Context = context
    override fun convert(holder: BaseViewHolder, item: SingleImageModel) {
        val img = holder.getView<ImageView>(R.id.recycler_item_video_img)
        val lp = img.layoutParams
        lp.width = getScreenWidth(context) / 4
        lp.height = getScreenWidth(context) / 4
        img.layoutParams = lp
        if (holder.position == 0) {
            Glide.with(context).load(R.mipmap.icon_camera).into(img)
        } else {
            Glide.with(context).load(item?.path).into(img)
        }


    }
}